/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2024-05-16 10:46:02
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2024-05-31 16:46:15
 * @FilePath: /consult-patient-vue3-ts/src/services/user.ts
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
 */
import type { User,CodeType,UserInfo} from '@/types/user'
import { request } from '@/utils/request'

//密码登录
export const loginByPassword = (mobile:string,password:string) => request<User>('/login/password','post',{mobile,password})

// 发送短信
export const sendMobildCode = (mobile:string,type:CodeType) => request('/code','get',{mobile,type})

// 短信验证码登录
export const loginByCode = (mobile:string,code:string) => request<User>('/login','post',{mobile,code})

// 获取个人信息
export const getUserInfo = () => request<UserInfo>('/patient/myUser')

// 查询患者详情
export const getPatientDetail = (id: string) => request<Patient>(`/patient/info/${id}`)
